<?php

namespace App\Console\Commands;

use App\model\customer\Customer;
use Illuminate\Console\Command;

class TestCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'test:name';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
       Customer::where('follow_status',Customer::kechongfen)->chunkById(100,function ($customers){
            foreach ($customers as $customer){
                $customer->follow_status=Customer::kegenjin;
                $customer->save();
            }
        });

    }
}
